/*-----------------------------------------------------------------------------
 * DriverDebug.h
 *-----------------------------------------------------------------------------
 * 
 *-----------------------------------------------------------------------------
 * All rights reserved by somma (fixbrain@gmail.com, unsorted@msn.com)
 *-----------------------------------------------------------------------------
 * - 10.11.2010 created
**---------------------------------------------------------------------------*/

#ifndef _DRV_DEBUG_H_
#define _DRV_DEBUG_H_


#define NUMBER_DEBUG_BUFFERS    (sizeof(g_DebugBufferBusy)/sizeof(g_DebugBufferBusy[0]))

#if DBG && defined(_X86_)
#undef ASSERT
#define ASSERT(e) if(!(e)){DbgPrint("Assertion failure in "\
	__FILE__ ", line %d: " #e "\n", __LINE__);\
	_asm int 3\
}
#endif

#if DBG
    VOID DrvDebugPrint(IN DWORD Level, IN const char* Function,IN const char* Format, IN ...);
#else
    __inline VOID DrvDebugPrint(IN DWORD Level, IN const char* Function,IN const char* Format, IN ...)
    {
        UNREFERENCED_PARAMETER(Level);
        UNREFERENCED_PARAMETER(Function);
	    UNREFERENCED_PARAMETER(Format);
    }
#endif	// DBG


#define DBG_ERR     DrvDebugPrint(DPFLTR_ERROR_LEVEL, __FUNCTION__, 
#define DBG_WARN    DrvDebugPrint(DPFLTR_WARNING_LEVEL, __FUNCTION__, 
#define DBG_TRACE   DrvDebugPrint(DPFLTR_TRACE_LEVEL, __FUNCTION__, 
#define DBG_INFO    DrvDebugPrint(DPFLTR_INFO_LEVEL, __FUNCTION__, 


#define DBG_END     );


PCHAR get_process_name(PEPROCESS eprocess, PCHAR name);
BOOLEAN SetProcessNameOffset(void);

#endif//_DRV_DEBUG_H_